import { request } from './request'
import axios from 'axios';
const urlTrue = import.meta.env.VITE_backurl_JAVA;
const token = sessionStorage.getItem("token");

//获取所有年份
// export const getTyphoonYears = data => {
//   return request({
//     // url: '/GetTyphoonYears',
//     // method: 'POST',
//     // data
//     url: "/typhoonHandler?m=getTyphoonYearList",
//     method: "get",
//   })
// }
// //根据年份获取台风数据
// export const getTyphoonByYear = params => {
//   return request({
//     // url: '/GetTyphoonByYear',
//     // method: 'POST',
//     // params
//     url: "/typhoonHandler?m=getTyphoonListByYear",
//     method: "get",
//     params
//   })
// }

export const getTyphoonYears = data => {
  return axios({
    url: urlTrue+"/typhoon/typhoonHandler?m=getTyphoonYearList&year&tyId",
    method: "get",
    headers: {
      Authorization: "Bearer",
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
      satoken: token,
    },
  })
}
//根据年份获取台风数据
export const getTyphoonByYear = params => {
  return axios({
    url: urlTrue+"/typhoon/typhoonHandler?m=getTyphoonListByYear",
    method: "get",
    params,
    // headers: {
    //   'Authorization': token
    // }
    headers: {
      Authorization: "Bearer",
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
      satoken: token,
    },
  })
}